package com.zx.viewlearn.activity;

import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.zx.viewlearn.R;
import com.zx.viewlearn.views.MyViewSun;


/**
 * @作者 zhoux
 * @创建时间 2018/1/8
 * @描述 自定义一个太阳系view
 * @修改时间 2018/1/8
 * @修改描述
 * @修改者 zhoux
 **/
public class ViewLearnActivity6Sun extends AppCompatActivity {
    MyViewSun myViewSun;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_learn_activity6_sun);
        myViewSun = findViewById(R.id.MyViewSun);

    }

    final Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
        }

    };

    @Override
    protected void onResume() {
        super.onResume();
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
//                myViewSun.addSun();
                myViewSun.addEarth(40,80);
            }
        }, 1000);
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
//                myViewSun.addSun();
//                myViewSun.getmBall().addEarth(20,40);
            }
        }, 2000);

    }
}
